// ''.match(/\s+/g)
// ''.match(/d+/g)
const _ = require('lodash');

const match = _.curry(function match (reg, str) {
  return str.match(reg);
});

const haveSpace = match(/\s+/g);
const haveNumber = match(/\d+/g);
const filter = _.curry(function (func, array) {
  return array.filter(func);
});
const findSpace = filter(haveSpace);

console.log(haveSpace('helloworld')); // null
console.log(haveNumber('123abc')); // ['123]
console.log(filter(haveSpace, ['John Connor', 'John_Donne'])); // [ 'John Connor' ] 
console.log(findSpace(['John Connor', 'John_Donne'])); // [ 'John Connor' ]